package org.easy.core.util;

import javax.servlet.http.HttpServletRequest;

public class RequestHeadUtil {

    interface CONSTANTS {
        String TOKEN = "Authorization";
        String LONGITUDE = "Lng";
        String LATITUDE = "Lat";
        String CLIENT_TYPE = "Client";
        String LOGIN_LOCATION = "Location";
    }

    public static String getToken(HttpServletRequest request) {
        return request.getHeader(CONSTANTS.TOKEN);
    }


    /**
     * 经度
     *
     * @param request
     * @return
     */
    public static String getLongitude(HttpServletRequest request) {
        return request.getHeader(CONSTANTS.LONGITUDE);
    }

    /**
     * 维度
     *
     * @param request
     * @return
     */
    public static String getLatitude(HttpServletRequest request) {
        return request.getHeader(CONSTANTS.LATITUDE);
    }

    /**
     * 1android 2ios 3web 4wechat
     *
     * @param request
     * @return
     */
    public static String getClientType(HttpServletRequest request) {
        return request.getHeader(CONSTANTS.CLIENT_TYPE);
    }

    /**
     * 登录地点
     *
     * @param request
     * @return
     */
    public static String getLoginLocation(HttpServletRequest request) {
        return request.getHeader(CONSTANTS.LOGIN_LOCATION);
    }


}
